package us.wili.dev.model.base;

import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.math.BigDecimal;
import us.wili.dev.common.model.BaseModelWithId;

public class BaseUser extends BaseModelWithId implements Serializable {
    @ApiModelProperty(value="手机号码")
    private String phone;

    @ApiModelProperty(value="昵称")
    private String nickName;

    @ApiModelProperty(value="头像")
    private String headImgUrl;

    @ApiModelProperty(value="性别；0:未知，1:男，2:女")
    private Integer sex;

    @ApiModelProperty(value="密码")
    private String pwd;

    @ApiModelProperty(value="盐值")
    private String salt;

    @ApiModelProperty(value="账户余额")
    private BigDecimal accountBlance;

    @ApiModelProperty(value="是否启用，1:启用，0:禁用")
    private Integer ifEnable;

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName == null ? null : nickName.trim();
    }

    public String getHeadImgUrl() {
        return headImgUrl;
    }

    public void setHeadImgUrl(String headImgUrl) {
        this.headImgUrl = headImgUrl == null ? null : headImgUrl.trim();
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd == null ? null : pwd.trim();
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt == null ? null : salt.trim();
    }

    public BigDecimal getAccountBlance() {
        return accountBlance;
    }

    public void setAccountBlance(BigDecimal accountBlance) {
        this.accountBlance = accountBlance;
    }

    public Integer getIfEnable() {
        return ifEnable;
    }

    public void setIfEnable(Integer ifEnable) {
        this.ifEnable = ifEnable;
    }

    public void copyPropertiesFrom(BaseUser source) {
        this.setPhone(source.getPhone());
        this.setNickName(source.getNickName());
        this.setHeadImgUrl(source.getHeadImgUrl());
        this.setSex(source.getSex());
        this.setPwd(source.getPwd());
        this.setSalt(source.getSalt());
        this.setAccountBlance(source.getAccountBlance());
        this.setIfEnable(source.getIfEnable());
    }

    public void copyAndIgnoreNullFrom(BaseUser source) {
        if (source.getPhone() != null) {
            this.setPhone(source.getPhone());
        }
        if (source.getNickName() != null) {
            this.setNickName(source.getNickName());
        }
        if (source.getHeadImgUrl() != null) {
            this.setHeadImgUrl(source.getHeadImgUrl());
        }
        if (source.getSex() != null) {
            this.setSex(source.getSex());
        }
        if (source.getPwd() != null) {
            this.setPwd(source.getPwd());
        }
        if (source.getSalt() != null) {
            this.setSalt(source.getSalt());
        }
        if (source.getAccountBlance() != null) {
            this.setAccountBlance(source.getAccountBlance());
        }
        if (source.getIfEnable() != null) {
            this.setIfEnable(source.getIfEnable());
        }
    }
}